﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLuaBase.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class YoozooGameplayLibertyLibertyNpcManagerWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(Yoozoo.Gameplay.Liberty.LibertyNpcManager);
			Utils.BeginObjectRegister(type, L, translator, 0, 9, 0, 0);
			
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadCondition", _m_LoadCondition);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "OnLoadNpc", _m_OnLoadNpc);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "Dispose", _m_Dispose);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "AddNpc", _m_AddNpc);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "RemoveNpc", _m_RemoveNpc);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetNpc", _m_GetNpc);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "AddCar", _m_AddCar);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "RemoveCar", _m_RemoveCar);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetCar", _m_GetCar);
			
			
			
			
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
			
			
            
			
			
			
            Utils.RegisterFunc(L, Utils.CLS_IDX, "New", __CreateInstanceNew);
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					var gen_ret = new Yoozoo.Gameplay.Liberty.LibertyNpcManager();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.Gameplay.Liberty.LibertyNpcManager constructor!");
            
        }

        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstanceNew(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 0)
				{
					
					var gen_ret = new Yoozoo.Gameplay.Liberty.LibertyNpcManager();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.Gameplay.Liberty.LibertyNpcManager constructor!");
            
        }

        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_LoadCondition(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                Yoozoo.Gameplay.Liberty.LibertyNpcManager gen_to_be_invoked = (Yoozoo.Gameplay.Liberty.LibertyNpcManager)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    int _id = LuaAPI.xlua_tointeger(L, 2);
                    int _type = LuaAPI.xlua_tointeger(L, 3);
                    
                        var gen_ret = gen_to_be_invoked.LoadCondition( _id, _type );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_OnLoadNpc(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                Yoozoo.Gameplay.Liberty.LibertyNpcManager gen_to_be_invoked = (Yoozoo.Gameplay.Liberty.LibertyNpcManager)translator.FastGetCSObj(L, 1);
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 7&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING)&& translator.Assignable<UnityEngine.Object>(L, 5)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 6)&& translator.Assignable<System.Action<int>>(L, 7)) 
                {
                    int _id = LuaAPI.xlua_tointeger(L, 2);
                    int _type = LuaAPI.xlua_tointeger(L, 3);
                    string _npcName = LuaAPI.lua_tostring(L, 4);
                    UnityEngine.Object _asset = (UnityEngine.Object)translator.GetObject(L, 5, typeof(UnityEngine.Object));
                    int _initNum = LuaAPI.xlua_tointeger(L, 6);
                    System.Action<int> _callback = translator.GetDelegate<System.Action<int>>(L, 7);
                    
                    gen_to_be_invoked.OnLoadNpc( _id, _type, _npcName, _asset, _initNum, _callback );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 6&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING)&& translator.Assignable<UnityEngine.Object>(L, 5)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 6)) 
                {
                    int _id = LuaAPI.xlua_tointeger(L, 2);
                    int _type = LuaAPI.xlua_tointeger(L, 3);
                    string _npcName = LuaAPI.lua_tostring(L, 4);
                    UnityEngine.Object _asset = (UnityEngine.Object)translator.GetObject(L, 5, typeof(UnityEngine.Object));
                    int _initNum = LuaAPI.xlua_tointeger(L, 6);
                    
                    gen_to_be_invoked.OnLoadNpc( _id, _type, _npcName, _asset, _initNum );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 5&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& (LuaAPI.lua_isnil(L, 4) || LuaAPI.lua_type(L, 4) == LuaTypes.LUA_TSTRING)&& translator.Assignable<UnityEngine.Object>(L, 5)) 
                {
                    int _id = LuaAPI.xlua_tointeger(L, 2);
                    int _type = LuaAPI.xlua_tointeger(L, 3);
                    string _npcName = LuaAPI.lua_tostring(L, 4);
                    UnityEngine.Object _asset = (UnityEngine.Object)translator.GetObject(L, 5, typeof(UnityEngine.Object));
                    
                    gen_to_be_invoked.OnLoadNpc( _id, _type, _npcName, _asset );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.Gameplay.Liberty.LibertyNpcManager.OnLoadNpc!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_Dispose(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                Yoozoo.Gameplay.Liberty.LibertyNpcManager gen_to_be_invoked = (Yoozoo.Gameplay.Liberty.LibertyNpcManager)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    
                    gen_to_be_invoked.Dispose(  );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_AddNpc(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                Yoozoo.Gameplay.Liberty.LibertyNpcManager gen_to_be_invoked = (Yoozoo.Gameplay.Liberty.LibertyNpcManager)translator.FastGetCSObj(L, 1);
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 6&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)&& translator.Assignable<UnityEngine.Vector3>(L, 5)&& translator.Assignable<UnityEngine.Quaternion>(L, 6)) 
                {
                    int _npcId = LuaAPI.xlua_tointeger(L, 2);
                    bool _random = LuaAPI.lua_toboolean(L, 3);
                    int _uniqueId = LuaAPI.xlua_tointeger(L, 4);
                    UnityEngine.Vector3 _pos;translator.Get(L, 5, out _pos);
                    UnityEngine.Quaternion _rot;translator.Get(L, 6, out _rot);
                    
                        var gen_ret = gen_to_be_invoked.AddNpc( _npcId, _random, _uniqueId, _pos, _rot );
                        LuaAPI.xlua_pushinteger(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 5&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& translator.Assignable<UnityEngine.Vector3>(L, 4)&& translator.Assignable<UnityEngine.Quaternion>(L, 5)) 
                {
                    string _npcName = LuaAPI.lua_tostring(L, 2);
                    int _uniqueId = LuaAPI.xlua_tointeger(L, 3);
                    UnityEngine.Vector3 _pos;translator.Get(L, 4, out _pos);
                    UnityEngine.Quaternion _rot;translator.Get(L, 5, out _rot);
                    
                    gen_to_be_invoked.AddNpc( _npcName, _uniqueId, _pos, _rot );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.Gameplay.Liberty.LibertyNpcManager.AddNpc!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_RemoveNpc(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                Yoozoo.Gameplay.Liberty.LibertyNpcManager gen_to_be_invoked = (Yoozoo.Gameplay.Liberty.LibertyNpcManager)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    int _uniqueId = LuaAPI.xlua_tointeger(L, 2);
                    
                    gen_to_be_invoked.RemoveNpc( _uniqueId );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetNpc(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                Yoozoo.Gameplay.Liberty.LibertyNpcManager gen_to_be_invoked = (Yoozoo.Gameplay.Liberty.LibertyNpcManager)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    int _uniqueId = LuaAPI.xlua_tointeger(L, 2);
                    
                        var gen_ret = gen_to_be_invoked.GetNpc( _uniqueId );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_AddCar(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                Yoozoo.Gameplay.Liberty.LibertyNpcManager gen_to_be_invoked = (Yoozoo.Gameplay.Liberty.LibertyNpcManager)translator.FastGetCSObj(L, 1);
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 4&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) 
                {
                    int _carId = LuaAPI.xlua_tointeger(L, 2);
                    bool _random = LuaAPI.lua_toboolean(L, 3);
                    int _uniqueId = LuaAPI.xlua_tointeger(L, 4);
                    
                        var gen_ret = gen_to_be_invoked.AddCar( _carId, _random, _uniqueId );
                        LuaAPI.xlua_pushinteger(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) 
                {
                    string _carName = LuaAPI.lua_tostring(L, 2);
                    int _uniqueId = LuaAPI.xlua_tointeger(L, 3);
                    
                    gen_to_be_invoked.AddCar( _carName, _uniqueId );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.Gameplay.Liberty.LibertyNpcManager.AddCar!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_RemoveCar(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                Yoozoo.Gameplay.Liberty.LibertyNpcManager gen_to_be_invoked = (Yoozoo.Gameplay.Liberty.LibertyNpcManager)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    int _uniqueId = LuaAPI.xlua_tointeger(L, 2);
                    
                    gen_to_be_invoked.RemoveCar( _uniqueId );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetCar(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                Yoozoo.Gameplay.Liberty.LibertyNpcManager gen_to_be_invoked = (Yoozoo.Gameplay.Liberty.LibertyNpcManager)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    int _uniqueId = LuaAPI.xlua_tointeger(L, 2);
                    
                        var gen_ret = gen_to_be_invoked.GetCar( _uniqueId );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        
        
        
        
        
		
		
		
		
    }
}
